/*
 * @Author: 飞越疯人院 353362604@qq.com
 * @Date: 2022-09-15 16:48:46
 * @LastEditors: 飞越疯人院 353362604@qq.com
 * @LastEditTime: 2023-02-15 17:30:35
 * @FilePath: \adminstration\src\Common\Modal\TwoModalList\LabReportTemplates.jsx
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { API_LIST } from '../../Api/Api'
import { TwoAddBtn, ThrDeleteBtn } from '../options'

export const CameraGroupDetail = async ({ upDataEvent, data, ClientData, Permission }) => {
    let dataList = {
        type: '摄像头分组信息',
        hideInSearch: true,
        pageSize: 10,
        params: { cameraGroupUuid: data.uuid },
        classification: 'TableModal',
        get: API_LIST([data.uuid])['getCameraGroupDetail'],
        additional: { key: 'cameraGroupUuid', value: 'uuid' },
        options: [
            Permission.findIndex(v => v.uuid === '641f2b6e-8a50-48d2-9b50-b972e997128a') !== -1 && (
                <TwoAddBtn
                    upDataEvent={upDataEvent}
                    title="添加摄像头"
                    ThrKey="ThrModal"
                    value="CameraGroupDetail"
                    data={data}
                />
            ),
        ],
        columns: [
            {
                title: '摄像头编号',
                dataIndex: 'cameraUuid',
                search: false,
                type: 'hidden',
                hideInTable: true,
            },
            {
                dataIndex: 'cameraName',
                title: '名称',
                valueType: 'input',
                width: 200,
            },
            {
                dataIndex: 'organizationName',
                title: '组织机构',
                valueType: 'input',
                width: 200,
            },
            {
                dataIndex: 'cameraPositionName',
                title: '位置',
                valueType: 'input',
                width: 200,
            },
            {
                dataIndex: 'cameraTypeName',
                title: '类型',
                valueType: 'input',
                width: 200,
            },
            {
                dataIndex: 'deviceSerial',
                title: '序列号',
                valueType: 'input',
                width: 200,
            },
            {
                title: '操作',
                valueType: 'systemOperation',
                fixed: 'right',
                width: 100,
                hideInSearch: true,
                hideInAdded: true,
                hideInModify: true,
                render: (_, record) => {
                    return [
                        Permission.findIndex(v => v.uuid === '2413888c-13fa-40c3-9fcc-5f82e544c935') !== -1 && (
                            <ThrDeleteBtn
                                key="delete"
                                record={record.uuid}
                                upDataEvent={upDataEvent}
                                data={{ key: 'delete', url: 'delCameraGroupDetail', title: '删除' }}
                            />
                        ),
                    ]
                },
            },
        ],
    }

    return dataList
}
